#!/bin/bash
for domain in w9.101 w9.102 w9.103 w9.104 w9.105;
do
sz=`virsh list |grep $domain |grep -c running`
if [[ sz -eq 0 ]];then
IP=192.168.${domain:1:5}
guestmount -d $domain -m /dev/sda2 /mnt
rm -f /mnt/etc/salt/minion_id
sed -i '/#master/s/#master: salt/master: 192.168.9.100/' /mnt/etc/salt/minion
umount /mnt
fi
done
